package com.laycoding.kafka.producer.Impl;

import com.laycoding.kafka.producer.KafkaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

/**
 * created with IntelliJ IDEA.
 *
 * @author: guidada
 * @date: 2021/04/18/16:41
 * @description:
 */
@Service
public class KafkaServiceImpl implements KafkaService {
   @Autowired
   private KafkaTemplate<String,Object> kafkaTemplate;

    @Override
    public void sendMessage(String topic,String msg) {
        kafkaTemplate.send(topic,msg);
    }
}
